package com.yikaiye.android.yikaiye.ui.activity.mine;

import com.yikaiye.android.yikaiye.R;
import com.yikaiye.android.yikaiye.base.BaseActivity;
import com.yikaiye.android.yikaiye.base.BaseViewModel;
import com.yikaiye.android.yikaiye.databinding.ActivitySetDefPhoneBinding;

/**
 * 设置默认手机号
 */
public class SetDefPhoneActivity extends BaseActivity<ActivitySetDefPhoneBinding, BaseViewModel> {

    private boolean isDef;

    @Override
    protected BaseViewModel bindModel() {
        return getViewModel(this, BaseViewModel.class);
    }

    @Override
    protected void initInject() {
        getActivityComponent().inject(this);
    }

    @Override
    protected void initData() {
        initTitleBar(getString(R.string.phone_number));
    }

    @Override
    protected void initClick() {
        viewModel.onDelayClick(binding.defIv, o -> {
            isDef = !isDef;
            binding.defIv.setImageResource(isDef ? R.mipmap.icon_open : R.mipmap.icon_off);
        });
        viewModel.onDelayClick(binding.tvSave, o -> {

        });
    }
}